const state = {
  name: 'admin',
  Token: '',
  applicationId: '',
  appId: '', // appId
  identity: 8, // 管理员身份
  // 主题色
  primaryColor: '#11afaf',
  modelList: []
};

const actions = {};

const mutations = {
  // 设置Token
  setTokens(state, data) {
    state.Token = data;
    console.log(state.Token, '设置了Token');
  },
  // 移除Token
  removeToken(state) {
    state.Token = '';
  },
  // 设置主题色
  setPrimaryColor(state, data) {
    state.primaryColor = data;
    console.log(state.primaryColor, '设置了主题色');
  },
  // 修改主题色
  changeThemeColor(state, val) {
    state.themeColor = val;
  },
  // 身份值
  identity(state, data) {
    state.identity = data;
  },
  // 排序数组
  modelList(state, data) {
    state.modelList = state;
  },
  applicationId(state, data) {
    state.applicationId = data;
  },
  // appid
  appId(state, data) {
    state.appId = data;
  }
};

export default {
  namespaced: true,
  state,
  actions,
  mutations
};
